console.log([1,2,10,3].sort());

let arr = [1,10,9,8];
arr.sort(function(x,y){
    if(x<y){
        return -1;
    }
    if(x<y){
        return 1;
    }
    return 0
})
console.log(arr);

let a = ['aaa','bbbb',''];
console.log(a.every(function(b){
    return b.length>0;
}));


let c = ['','bbbb','a'];
console.log(c.find(function(d){
    return d.length>0;
}));

let bf = ['','bbbb','a'];
console.log(bf.findIndex(function(cod){
    return cod.length===0;
}));

let r6s = ['asd','sds','qwe'];
r6s.forEach(console.log);

function lazy_sum(dddd){
    let sum = function (){
        return dddd.reduce(function(x,y){
            return x + y;
        });
    }
    return sum;
}
console.log(lazy_sum);
let ee = lazy_sum([1,2,5])
console.log(ee());